Skip to content

Remove TraversePropertiesDsl from top-level toDataFrame {} operation - #2004

Draft
zaleslaw with Copilot wants to merge 3 commits into
masterfrom
copilot/remove-traversepropertiesdsl
Draft

Remove TraversePropertiesDsl from top-level toDataFrame {} operation#2004
zaleslaw with Copilot wants to merge 3 commits into
masterfrom
copilot/remove-traversepropertiesdsl

Conversation

Copilot AI commented Jul 28, 2026

Copy link
Copy Markdown

Top-level preserve() / exclude() calls inside toDataFrame {} had broken semantics: they were supposed to apply to all properties {} blocks but did not work reliably, and calling them without any properties {} block produced an empty DataFrame. The compiler plugin also never supported this notation.

Changes

  • CreateDataFrameDsl<T> no longer extends TraversePropertiesDslexclude() and preserve() are no longer directly available at the top level of toDataFrame {}
  • CreateDataFrameDslImpl — removed TraversePropertiesDsl by configuration delegation
  • Deprecated shimsexclude(), preserve(), and preserve<T>() are kept on CreateDataFrameDsl with DeprecationLevel.WARNING (→ ERROR in 1.1), forwarding to a properties {} block to ease migration
  • Binary API — updated via apiDump; methods remain in bytecode for binary compatibility

Migration

// Before (broken — top-level preserve silently ignored without properties())
toDataFrame {
    preserve(DataFrame::class)
}

// Before (confusing — top-level preserve applied to all properties blocks)
toDataFrame {
    preserve(DataFrame::class)
    properties()
}

// After (correct)
toDataFrame {
    properties(maxDepth = Int.MAX_VALUE) {
        preserve(DataFrame::class)
    }
}

Copilot AI linked an issue Jul 28, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Remove TraversePropertiesDsl from top-level toDataFrame {} operation Remove TraversePropertiesDsl from top-level toDataFrame {} operation Jul 28, 2026
Copilot AI requested a review from zaleslaw July 28, 2026 11:04
@Jolanrensen Jolanrensen self-assigned this Jul 29, 2026
@Jolanrensen

Copy link
Copy Markdown
Collaborator

Seems like a good base, I'll continue from this

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR simplifies the Iterable<T>.toDataFrame {} DSL by removing TraversePropertiesDsl from the top-level receiver, so traversal-related configuration (exclude/preserve) is scoped to properties {} blocks (matching the compiler plugin’s supported notation and avoiding previously confusing/broken behavior).

Changes:

  • Remove TraversePropertiesDsl inheritance/delegation from CreateDataFrameDsl / CreateDataFrameDslImpl.
  • Add WARNING-level deprecated shims (exclude/preserve and preserve<T>()) on CreateDataFrameDsl to ease source migration.
  • Update tests, generated sources, and apiDump to reflect the new API surface.

Reviewed changes

Copilot reviewed 5 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/api/toDataFrame.kt Updates the test to use preserve<T>() inside a properties {} block.
core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/util/deprecationMessages.kt Adds a dedicated deprecation message for the removed top-level traversal DSL usage.
core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/api/toDataFrame.kt Removes TraversePropertiesDsl delegation from CreateDataFrameDslImpl.
core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/toDataFrame.kt Removes TraversePropertiesDsl from CreateDataFrameDsl and adds deprecated migration shims.
core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/util/deprecationMessages.kt Regenerates the deprecation message constant.
core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/api/toDataFrame.kt Regenerates the CreateDataFrameDslImpl signature without delegation.
core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/toDataFrame.kt Regenerates the public DSL API with deprecated shims and updated inheritance.
core/api/core.api Updates the binary API dump to reflect removed supertype and added shim methods.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/util/deprecationMessages.kt Outdated
Copilot AI and others added 2 commits July 29, 2026 15:42
- Remove TraversePropertiesDsl as supertype of CreateDataFrameDsl<T>
- Remove TraversePropertiesDsl delegation from CreateDataFrameDslImpl
- Add deprecated exclude/preserve methods to CreateDataFrameDsl with deprecation warning pointing to properties {} block
- Add deprecated preserve<T>() extension for CreateDataFrameDsl
- Update preserve T test to use properties {} block instead of top-level preserve()
- Update generated sources and binary API file
- Add TRAVERSE_PROPERTIES_DSL deprecation message constant
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@Jolanrensen
Jolanrensen force-pushed the copilot/remove-traversepropertiesdsl branch from 13f7721 to 72f2d66 Compare July 29, 2026 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove TraversePropertiesDsl from top-level toDataFrame {} operation

4 participants